import http from '../http'
import config from '../config'

class HomeService {
    
    async index (params: any) {
        return await http.getInstance().get(
            config.ApiUrl.index,
            params,
            {
                Authorization: localStorage.getItem("token")
            }
        )
    }
    async getTemplate (params: any) {
        return await http.getInstance().post(
            config.ApiUrl.getTemplate,
            params,
            {
                Authorization: localStorage.getItem("token")
            }
        )
    }

    async list (params: any) {
        return await http.getInstance().post(
            config.ApiUrl.list,
            params,
            {
                Authorization: localStorage.getItem("token")
            }
        )
    }
    
    async clothesList (params: any) {
        return await http.getInstance().post(
            config.ApiUrl.clothesList,
            params,
            {
                Authorization: localStorage.getItem("token")
            }
        )
    }
    
    async updateScene (params: any) {
        return await http.getInstance().post(
            config.ApiUrl.updateScene,
            params,
            {
                Authorization: localStorage.getItem("token")
            }
        )
    }
    
    async updateAssets (params: any) {
        return await http.getInstance().post(
            config.ApiUrl.updateAssets,
            params,
            {
                Authorization: localStorage.getItem("token")
            }
        )
    }
    
    async selectOne (params: any) {
        return await http.getInstance().get(
            config.ApiUrl.selectOne,
            params,
            {
                Authorization: localStorage.getItem("token")
            }
        )
    }
}

export default new HomeService()